home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
libsrc11.arc
/
RDBYTAD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-27
|
806b
|
40 lines
/* rdbytad.c 4.5 */
/*F****************************************************************************
FUNCTION NAME: rdbytad
ACTION: Reads a character from the A to D hardware.
PARAMETERS:
int i: A to D Conversion Register Index.
RETURNS: (void)
******************************************************************************/
#define ATODLINES 4 /* number of A to D Conversion Registers */
#include <hc11/io.h>
#include <hc11/atod.h>
#include <hc11/config.h>
#include <hc11/directives.h>
SMALL
unsigned rdbytad(i)
int i;
{
HC11.OPTION |= ADPU;
HC11.ADCTL = HC11.ADCTL; /* force conversion */
while ((HC11.ADCTL & CCF) == 0)
; /* null statement */
return ((unsigned) HC11.ADR[((unsigned short) i) & (ATODLINES-1)]);
} /* end of rdbytad */